﻿using System;
using System.Collections.Generic;

class BinarySearch
{
    static void Main(string[] args)
    {
        int[] arr = new int[21];
        int k = int.Parse(Console.ReadLine());
        int maxLength = arr.Length - 1;
        int minLength = 0;

        for (int i = 0; i < arr.Length; i++)
        {
            arr[i] = i;
            Console.Write("{0} ", arr[i]);
        }
        Console.WriteLine();
        while (maxLength >= minLength)
        {
            int midPoint = (minLength + maxLength) / 2;
            if (midPoint == k)
            {
                Console.WriteLine("The index of {0} is {1}", k, midPoint);
                break;
            }

            if (midPoint < k)
            {
                minLength = midPoint + 1;

            }
            if (midPoint > k)
            {
                maxLength = midPoint - 1;

            }


        }
    }
}

